<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<s:actionerror />
<s:actionmessage />
<s:fielderror />			
<h1>搭售商品管理<br/>
<div class="f-link"><a href="add.do">新增</a></div>
</h1>
<div class="data-form"><s:form action="list.do" method="post">
	<b>主商品编号：</b>
	<input name="mainProductIdParam" id="mainProductIdParam" type="text" title="主商品编号" size="30"
		value="${mainProductIdParam}">	
	<b>次商品编号：</b>
	<input name="addonProductIdParam" id="addonProductIdParam" type="text" title="次商品编号" size="30"
		value="${addonProductIdParam }">
	<br />
	<b>搭售活动状态：</b>
	<select name="addonstatus">
 		<option value="" ${empty addonstatus ? 'selected': ''}>请选择</option>
		<option value="1" ${addonstatus == '1' ? 'selected': ''}>未开始</option>
 		<option value="2" ${addonstatus == '2' ? 'selected': ''}>进行中</option>
 		<option value="3" ${addonstatus == '3' ? 'selected': ''}>已结束</option>	
	</select>		
	<input type="button" value="搜寻" onclick="this.form.submit();" />
</s:form>
</div>
<br />
<br />
<table class="tb-1" width="100%">
	<thead>
		<tr>        	
			<th>#</th>
			<th>(主商品编号)<br/>商品名称</th>
			<th>(次商品编号)<br/>商品名称</th>
			<th>搭售价格</th>
			<th>活动<br/>起迄时间</th>
			<th>是否<br/>启用</th>
			<th>编辑</th>
		</tr>
	</thead>
	<tbody>
			<c-rt:forEach items="${addonproducts}" var="addonproduct" varStatus="rows_index">			  
			<tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''}">
				<td>${addonproduct[0]}</td>
        <td>(${addonproduct[1]})<br/>${addonproduct[2]}</td>
				<td>(${addonproduct[3]})<br/>${addonproduct[4]}</td>
				<td><fmt:formatNumber value="${addonproduct[5]}" pattern="######0.0"/></td>
				<td><fmt:formatDate value="${addonproduct[6]}" pattern="yyyy/MM/dd HH:mm:ss" />				
				<br/><fmt:formatDate value="${addonproduct[7]}"	pattern="yyyy/MM/dd HH:mm:ss" />
				</td>
				<td>
				<c:if test="${addonproduct[8] eq 'Y'}">是</c:if>
				<c:if test="${addonproduct[8] eq 'N'}">否</c:if>
				</td>	
				<td>
				<a href="<%=ServerValue.getMidContextPath()%>/addonproduct/edit.do?addonId=${addonproduct[0]}" />编辑</a> 
				</td>
							
	 		 </tr>             
			</c-rt:forEach>			
	</tbody>
</table>
<yaodian100:pageutil link="list.do" pagerObj="${pager}" />


		
